package com.itheima.struts.demo6;

import java.util.List;

import com.itheima.struts.domain.Product;
import com.opensymphony.xwork2.ActionSupport;

/**
 * Struts2的复杂类型的数据封装 封装到List集合中
 * @author Unicorn
 * @version v1.0
 * @createTime 2019年3月1日 下午2:00:06
 *
 */
public class ProductAction1 extends ActionSupport {
	private static final long serialVersionUID = 1L;
	private List<Product> products;
	// 提供集合的get和set方法
	public List<Product> getProducts() {
		return products;
	}
	public void setProducts(List<Product> products) {
		this.products = products;
	}
	
	@Override
	public String execute() throws Exception {
		for (Product product : products) {
			System.out.println(product);
		}
		return NONE;
	}
}
